<!--

    Copyright (c) 2015 Codenvy, S.A.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

    Contributors:
      Codenvy, S.A. - initial API and implementation

-->
<div class="left-sidebar-container">
  <md-toolbar class="flex-shrink-none">
    <md-progress-linear md-mode="indeterminate" ng-hide="navbarCtrl.email"></md-progress-linear>
    <div ng-show="navbarCtrl.email">
      <section class="navbar-top-dropdown" layout="column" layout-align="center center">
        <che-button-dropdown che-button-dropdown-href="#/create-project" che-button-dropdown-label="New Project"
                             che-event-logger="new.project"
                             che-button-dropdown-controller="navbarCtrl"
                             ng-if="navbarCtrl.isUser()"></che-button-dropdown>
      </section>
      <md-divider md-theme="factory-theme"></md-divider>
      <div class="admin-navbar-menu">
        <section class="left-sidebar-menu" layout="column" layout-align="center center">
          <md-list layout="column">
            <ide-list-item-navbar></ide-list-item-navbar>
            <md-list-item flex class="navbar-subsection-item" ng-if="navbarCtrl.isUser()">
              <md-button nav-bar-selected flex che-reload-href ng-href="{{navbarCtrl.menuItemUrl.dashboard}}" layout-align="left"
                         target="_self">
                <div class="navbar-item" layout="row" layout-align="start center">
                  <i class="fa fa-th-large icon">&nbsp;</i>
                  <span>Dashboard</span>
                </div>
              </md-button>
            </md-list-item>
            <md-list-item flex class="navbar-subsection-item">
              <md-button nav-bar-selected flex che-reload-href ng-href="{{navbarCtrl.menuItemUrl.workspaces}}" layout-align="left"
                         che-event-logger="workspaces">
                <div class="navbar-item" layout="row" layout-align="start center">
                  <i class="fa fa-server fa-lg icon">&nbsp;</i>
                  <span>Workspaces</span>
                </div>
              </md-button>
            </md-list-item>
            <md-list-item flex class="navbar-subsection-item" ng-if="navbarCtrl.isUser()">
              <md-button nav-bar-selected flex che-reload-href ng-href="{{navbarCtrl.menuItemUrl.projects}}" layout-align="left"
                         che-event-logger="projects">
                <div class="navbar-item" layout="row" layout-align="start center">
                  <i class="fa fa-folder-open icon">&nbsp;</i>
                  <span>Projects</span>
                </div>
              </md-button>
            </md-list-item>
            <md-list-item flex class="navbar-subsection-item" ng-if="navbarCtrl.isFactoryServiceAvailable">
              <md-button nav-bar-selected flex che-reload-href ng-href="{{navbarCtrl.menuItemUrl.factories}}" layout-align="left"
                         che-event-logger="factories">
                <div class="navbar-item" layout="row" layout-align="start center">
                  <i class="chefont cheico-rocket-chefont icon">&nbsp;</i>
                  <span>Factories</span>
                </div>
              </md-button>
            </md-list-item>
          </md-list>
        </section>
      </div>
      <md-divider ng-show="navbarCtrl.isAdminServiceAvailable" md-theme="factory-theme"></md-divider>
      <div ng-show="navbarCtrl.isAdminServiceAvailable" class="admin-navbar-menu"
           ng-init="configMenuIsExpand=true">
        <div class="navbar-identity"
             flex layout="row" layout-align="start center" ng-click="configMenuIsExpand=!configMenuIsExpand">
      <span flex layout="row" layout-align="start center" layout-padding>
        <i class="material-design icon-ic_build_24px">&nbsp;</i>
        <span flex class="navbar-title">Configuration</span>
      </span>
          <i class="material-design md-tab-themed" ng-class="configMenuIsExpand ? 'icon-ic_expand_less_24px' : 'icon-ic_expand_more_24px'">
            &nbsp;</i>
        </div>
        <section class="animation navbar-subsection"
                 flex layout="column" layout-align="center start" layout-fill
                 class="animation"
                 ng-if="configMenuIsExpand">
          <md-list layout="column" flex>
            <md-list-item ng-show="navbarCtrl.isAdminPluginServiceAvailable" flex class="navbar-subsection-item">
              <md-button nav-bar-selected flex che-reload-href ng-href="{{navbarCtrl.menuItemUrl.plugins}}" layout-align="left"
                         che-event-logger="account">
                <div class="navbar-item" layout="row" layout-align="start center">Plug-Ins</div>
              </md-button>
            </md-list-item>
          </md-list>
        </section>
      </div>
      <md-divider md-theme="factory-theme" ng-show="navbarCtrl.isUser()"></md-divider>
    </div>
  </md-toolbar>
</div>
